import {BaseEntity, Column, Entity, Index, JoinColumn, JoinTable, ManyToMany, ManyToOne, OneToMany, OneToOne, PrimaryColumn, PrimaryGeneratedColumn, RelationId} from 'typeorm';

@Entity('fa_user', {schema: 'fastadmin' } )
@Index('username', ['username' ])
@Index('email', ['email' ])
@Index('mobile', ['mobile' ])
export class fa_user {

    @PrimaryGeneratedColumn({
        type: 'int',
        name: 'id',
        })
    id: number;

    @Column('int', {
        nullable: false,
        default: () => '\'0\'',
        name: 'group_id',
        })
    group_id: number;

    @Column('varchar', {
        nullable: false,
        length: 32,
        name: 'username',
        })
    username: string;

    @Column('varchar', {
        nullable: false,
        length: 50,
        name: 'nickname',
        })
    nickname: string;

    @Column('varchar', {
        nullable: false,
        length: 32,
        name: 'password',
        })
    password: string;

    @Column('varchar', {
        nullable: false,
        length: 30,
        name: 'salt',
        })
    salt: string;

    @Column('varchar', {
        nullable: false,
        length: 100,
        name: 'email',
        })
    email: string;

    @Column('varchar', {
        nullable: false,
        length: 11,
        name: 'mobile',
        })
    mobile: string;

    @Column('varchar', {
        nullable: false,
        name: 'avatar',
        })
    avatar: string;

    @Column('tinyint', {
        nullable: false,
        default: () => '\'0\'',
        name: 'level',
        })
    level: number;

    @Column('tinyint', {
        nullable: false,
        default: () => '\'0\'',
        name: 'gender',
        })
    gender: number;

    @Column('date', {
        nullable: true,
        name: 'birthday',
        })
    birthday: string | null;

    @Column('varchar', {
        nullable: false,
        length: 100,
        name: 'bio',
        })
    bio: string;

    @Column('decimal', {
        nullable: false,
        default: () => '\'0.00\'',
        scale: 2,
        name: 'money',
        })
    money: string;

    @Column('int', {
        nullable: false,
        default: () => '\'0\'',
        name: 'score',
        })
    score: number;

    @Column('int', {
        nullable: false,
        default: () => '\'1\'',
        name: 'successions',
        })
    successions: number;

    @Column('int', {
        nullable: false,
        default: () => '\'1\'',
        name: 'maxsuccessions',
        })
    maxsuccessions: number;

    @Column('int', {
        nullable: true,
        name: 'prevtime',
        })
    prevtime: number | null;

    @Column('int', {
        nullable: true,
        name: 'logintime',
        })
    logintime: number | null;

    @Column('varchar', {
        nullable: false,
        length: 50,
        name: 'loginip',
        })
    loginip: string;

    @Column('tinyint', {
        nullable: false,
        default: () => '\'0\'',
        name: 'loginfailure',
        })
    loginfailure: number;

    @Column('varchar', {
        nullable: false,
        length: 50,
        name: 'joinip',
        })
    joinip: string;

    @Column('int', {
        nullable: true,
        name: 'jointime',
        })
    jointime: number | null;

    @Column('int', {
        nullable: true,
        name: 'createtime',
        })
    createtime: number | null;

    @Column('int', {
        nullable: true,
        name: 'updatetime',
        })
    updatetime: number | null;

    @Column('varchar', {
        nullable: false,
        length: 50,
        name: 'token',
        })
    token: string;

    @Column('varchar', {
        nullable: false,
        length: 30,
        name: 'status',
        })
    status: string;

    @Column('varchar', {
        nullable: false,
        name: 'verification',
        })
    verification: string;

}
